package net.roseparadise.controller;

import net.roseparadise.model.Album;
import net.roseparadise.service.MessageService;
import net.roseparadise.service.NoticeService;
import net.roseparadise.service.PhotoService;

import org.directwebremoting.annotations.Param;
import org.directwebremoting.annotations.RemoteProxy;
import org.directwebremoting.spring.SpringCreator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/action/MainHome.htm")
//@RemoteProxy(creator = SpringCreator.class, creatorParams = @Param(name = "beanName", value = "MainHomeController"), name = "MainHomeAjax")   

//@SessionAttributes("currUser")
public class MainHomeController {
	@Autowired
	private NoticeService noticeService;
	@Autowired
	private MessageService messageService;
	@Autowired
	private PhotoService photoService;

	@RequestMapping(params = "cmd=show")
	public String showMainHome(ModelMap map){
		
		map.addAttribute("photoPVO", photoService.getPortletContent(1));
		map.addAttribute("messagePVO", messageService.getPortletContent());
		map.addAttribute("noticePVO", noticeService.getPortletContent());
		return "mainhome";
	}
}
